package org.agony2d.gpu.supportClasses.programs {
	import flash.display3D.Context3DVertexBufferFormat;
	import org.agony2d.gpu.supportClasses.textures.FullTexture;
	import org.agony2d.core.agony_internal;
	
	use namespace agony_internal;
	
public class TintedProgram extends ProgramProxy {
  
	override protected function get vertexCode() : String {
		return  "m44 op, va0, vc0 \n" + 
				"mov v0, va1 \n" +
				"mov v1, va2.zyxw \n"
	}
	
	override protected function get fragmentCode() :String {
		return 	"tex ft0, v0, fs0<2d, nearest, mipnone> \n" + 
				"mul oc,  v1, ft0 \n"
	}
	
	override agony_internal function setProperties( fullTexture:FullTexture ) : void {
		super.setProperties(fullTexture)
		
		// agal color...
		g_context3d.setVertexBufferAt(2, g_currGroup.m_vb3d, 4, Context3DVertexBufferFormat.BYTES_4)
	}
	
	override agony_internal function drawAndReset() : void {
		super.drawAndReset()
		g_context3d.setVertexBufferAt(2, null)
	}
}
}